<?php
// +-------------------------------------------------------------------
// |
// +-------------------------------------------------------------------
// | Copyright (c) 2009-2016 All rights reserved.
// +-------------------------------------------------------------------
namespace Service\Api\V1;

class EyeQuestionList
{
    public $login = false; //是否需要登录才能访问该接口
    public $title = "常见问题列表";
    public $group = '常见问题';
    public $desc = "";

    public $input = [
        'page_num' => 'int;label=分页;comment=默认为1',
        'page_size' => 'int;label=分页条数;comment=默认为5',
    ];

    public $output = [
        'list' => [
            [
                'id' => 'label=id;',
                'title' => 'label=问题;',
                'answer' => 'label=答案;',
            ],
        ]
    ];

    public function run($param, $uid)
    {
        $type_list = (array)M('eyes_question')->where(['status' =>1])->order('sort desc')->select();

        return ['list' => $type_list];
    }
}
